<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 苹果3元一个，鸭梨2元，桃子1元1个，现在有200元正好买100个水果
    // 苹果 i  鸭梨 j  桃子 z 
    for (var i = 0; i <= 100; i++) {
      for (var j = 0; j <= 100; j++) {
        for (var z = 0; z <= 100; z++) {
          if (3 * i + 2 * j + z === 200 && i + j + z === 100) {
            console.log('苹果' + i + '个,鸭梨' + j + '个,桃子' + z + '个');
          }
        }
      }
    }
  </script>
</body>

</html>